// 发送请求获取数据
axios('/data')
    .then(response => response.json())
    .then(data => {
        // 使用Echarts绘制折线图
        var chart = echarts.init(document.getElementById('chart'));
        var option = {
            xAxis: {
                type: 'category',
                data: data.map(item => item.name)
            },
            yAxis: {
                type: 'value'
            },
            series: [{
                type: 'line',
                data: data.map(item => item.value)
            }]
        };
        chart.setOption(option);
    });